package com.bertie.smiles2iupac;

import static org.junit.Assert.assertEquals;

import org.junit.Test;

public class SmileToIupacConverterTest {
	private final static String SMILES[] = {"C(C(C(C(C(C)))))","CC(C)(C)CCCCCCC","CCCCCCCCC(CCCCCCCCC)CCCCCCCCC","CCCCC(C)","CC(C)","C(C)(C)"," C   C	C \r\n","C(C)(C)C","C(C)CC","CCC(C)(C)CC","CCC(C)CC","CCCCC(C(C)C)CCCC","CCCCC(CC(C)C)CCCC","CCC(C)(C)C(CC)CCC","CCCC(CC)C(C)CCC","CC(C)C(C)CC(C)C","CCCC(C(C)C)C(CCC)CCC","CCCCC(C(C)CC)CCCC","CCCCCCC(CCC(C)C)CCCCCC","CCCCCC(CC(C)(C)C)CCCCC","CCCCCC(C(C)(C)CC)CCCCC","CCCC(CCC)C(C)CCCC","CC(C)CCCCC(C)C(C)CC","CCCCCCC(C(C)CCCC)CCCCCC","CCCCCCC(CC(C)CCC)CCCCCC","CCCCCCCC(CCCCC(C)C)CCCCCCC","CCCCCC(C(C)(C)C)CCCCC","CCCCCCC(CCCC(C)C)CCCCCC","CCCCC(CC)CC(C(C)C(C)CCC)CCCCCC","CCCCCC(C(C)CCC)CC(CC(C)CC)CCCCC","CC(C)CCC(C(CC)(CC)CC)(C(CC)(CC)CC)CCCCC","CC(C)C(C)C(CCC)C(C)CC","CC(C)CC(CC(C)C)C(C)CC","CCCCC(CCC)C(C(C(C)C)CCCC)CCCCCC","CCC(CC)CC(C)CC(CC(C)CC(C)CC)(CC(C)CC(C)CC)CC(C)CC(C)CC"};
	private final static String IUPAC[] = {"Hexane","2,2-Dimethylnonane","10-Octylnonadecane","Hexane","Propane","Propane","Propane","2-Methylpropane","Butane","3,3-Dimethylpentane","3-Methylpentane","5-Isopropylnonane","5-Isobutylnonane","4-Ethyl-3,3-dimethylheptane","4-Ethyl-5-methyloctane","2,3,5-Trimethylhexane","4-Isopropyl-5-propyloctane","5-sec-Butylnonane","7-Isopentyltridecane","6-Neopentylundecane","6-tert-Pentylundecane","5-Methyl-4-propylnonane","2,7,8-Trimethyldecane","7-(1-Methylpentyl)tridecane","7-(2-Methylpentyl)tridecane","8-(5-Methylhexyl)pentadecane","6-tert-Butylundecane","7-Isohexyltridecane","7-(1,2-Dimethylpentyl)-5-ethyltridecane","6-(1-Methylbutyl)-8-(2-methylbutyl)tridecane","5,5-Bis(1,1-diethylpropyl)-2-methyldecane","2,3,5-Trimethyl-4-propylheptane","4-Isobutyl-2,5-dimethylheptane","6-(1-Isopropylpentyl)-5-propyldodecane","7,7-Bis(2,4-dimethylhexyl)-3-ethyl-5,9,11-trimethyltridecane"};
	
	@Test
	public void testSmileToIupacConverter() {
		for(int j=0;j<SMILES.length;j++){
			assertEquals(Iupac.buildFromMolecule(Molecule.buildFromSmilesFormatString(SMILES[j])), IUPAC[j]);
		}
	}
}